package com.itheima.d04_static_method_use;

import java.util.Random;

/*
   工具类
   1.生成验证码的功能
   2.对密码进行加密功能
 */
public class My {
    public static String getCode(int n) {
        String str = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
        Random r = new Random();
        String code = "";
        for (int i = 0; i < n; i++) {
            code += str.charAt(r.nextInt(str.length()));
        }
        return code;


    }

    public static String login(String name, String password) {

        return name + "_" + password;
    }
public static String logout() {
            return "退出成功";
}

}




